const STSTEM_INFO = uni.getSystemInfoSync();

// 顶部返回按钮安全距离
export const getStatusBarHeight = () => STSTEM_INFO.statusBarHeight || 0;

// 获取小程序胶囊的信息
export const getTitleBarHeight = () => {
    if(uni.getMenuButtonBoundingClientRect()){
        let { top,height } = uni.getMenuButtonBoundingClientRect();
        return height + (top - getStatusBarHeight()) * 2;
    }else{
        return 40;
    }
}

// 距离顶部（轮播图）的安全距离
export const getNavBarHeight = () => getStatusBarHeight() + getTitleBarHeight()